<template>
  <div class="index">
    我是user
    <van-button 
      @click="logout"
      round block 
      color="var(--van-primary-color)">
      推出
      </van-button>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import { useStore } from 'vuex'
export default defineComponent({
  setup () {
    const store = useStore();
    const logout = function(){
      store.dispatch('logout')
    }
    return {
      logout
    }
  }
})
</script>

<style lang="scss">

</style>